
package com.yuanmei.model;

import com.yuanmei.common.Utils;

import io.realm.RealmObject;
import io.realm.annotations.PrimaryKey;

//import io.realm.annotations.Ignore;


public class HistoryHourQuote extends RealmObject implements KLineChartQuote{

    @PrimaryKey
    private String date;

    private float open, close, high, low, volume;

    public String getDate() {
        return this.date;
    }

    public void setDate(String date) {
        this.date = date;
    }

    public float getOpen() {
        return this.open;
    }

    public void setOpen(float open) {
        this.open = open;
    }

    public float getHigh() {
        return this.high;
    }

    public void setHigh(float high) {
        this.high = high;
    }

    public float getLow() {
        return this.low;
    }

    public void setLow(float low) {
        this.low = low;
    }

    public float getClose() {
        return this.close;
    }

    public void setClose(float close) {
        this.close = close;
    }

    public float getVolume() {
        return this.volume;
    }

    public void setVolume(float volume) {
        this.volume = volume;
    }

    public boolean isQualified() {
        return (this.close > 0.0f) && (this.volume > 0.0f) && (this.open > 0.0f)
                && (this.high > 0.0f) && (this.low > 0.0f);
    }

    public HistoryHourQuote() {
        super();
    }

    public HistoryHourQuote(String date, float open, float high, float low, float close,
                     float volume) {
        this.date = date;
        this.open = open;
        this.close = close ;
        this.high =  high;
        this.low = low;
        this.volume = volume;
    }

    @Override
    public String getQuoteDate() {
        return getDate();
    }

    @Override
    public int getQuoteIDate() {
        return Utils.parseTTDateStringToIDate(this.date);
    }

    @Override
    public float getQuoteOpen() {
        return getOpen();
    }

    @Override
    public float getQuoteHigh() {
        return getHigh();
    }

    @Override
    public float getQuoteLow() {
        return getLow();
    }

    @Override
    public float getQuoteClose() {
        return getClose();
    }

    @Override
    public float getQuoteVolume() {
        return getVolume();
    }

    @Override
    public float getQuoteAmount() {
        return 0;
    }

    @Override
    public float getQuoteTurnover() {
        return 0;
    }

    @Override
    public float getQuotePchg() {
        return 0;
    }
}
